Accelerative noise filtering method for image data

ABSTRACT

An accelerative noise filtering method for image data is provided. The present invention includes selecting four neighboring pixels around a target pixel in a pattern of a cross shape or X shape, and calculating the absolute value of a difference between the target pixel and each of the four neighboring pixels. When the absolute value of the difference of the neighboring pixel is not larger than a standard deviation, a binary value of a bit corresponding to the neighboring pixel is set “1”. When the absolute value of the difference of the neighboring pixel is larger than a standard deviation, a binary value of a bit corresponding to the neighboring pixel is set “0”. Consequently, a 4-bit mapping table including the binary values of the four neighboring pixels is obtained. Then, a new pixel value for replacing the target pixel value is calculated based on a calculation derived from the 4-bit mapping table.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a technology for processing image data. More particularly, the present invention relates to a method for effectively and rapidly filtering noise generated when obtaining and coding image data.

[0003] 2. Description of the Prior Art

[0004] At present, when high compression of image data is performed by means of image data coding, preprocessing and post-processing the image data is believed to be important.

[0005] Several schemes have been proposed to filter noise generated when obtaining and coding image data, such as median filter, MTM (modified trimmed mean) filter, FMH (FIR-median hybrid) filter, edge preserving smoothing filter, etc.

[0006] The median filter is a nonlinear recovering technology, which is designed to filter impulse type noises from the image, while preserving the edge. Usually the two-dimensional median filter uses a 3×3 or 5×5 rectangular mask to enclose the pixel to be filtered. For the median filtering method, the gray level of each pixel is replaced by the median of the gray levels in a neighborhood of that pixel, instead of by average. The median of a set of values is such that half the values in the set are less than m and half are greater than m. In order to perform median filtering in a neighborhood of a pixel, the values of the pixel and its neighbors are sorted to determine the median, and assign this value to the pixel.

[0007] MTM filters are a combination of the median filter and mean value filter. Consequently, they can overcome the disadvantage of the median filter and improving the noise suppressing effect. In the processing, the median is first derived. The mean value filter is then applied on the pixel having a value near it as the object, and the result is output. A topic to be solved is how to set the object range of the mean value filter in consideration of the characteristics of the image. Also, it has been pointed out that, compared with the conventional median filter, the edge portion becomes more blurred.

[0008] Just as MTM filters, FMH filters are also a combination of the median filter and the mean value filter. However, FMH filters differ from MTM filters in that a mean value filter is applied first. Also, the mask for the mean value filter has a directionality with quantization in 90° or 450°. Compared with MTM filters, they can suppress blurriness of the edge portion, and the amount of computation required can be reduced significantly.

[0009] The edge preserving smoothing filter is a type of selective smoothing filter. It performs adaptive switching of the mask according to the localized properties of the region. Several types of polygonal masks are initially defined. Then, the degree of the variation in the pixel value in the region corresponding to each mask is calculated. Then, among the masks, the mask with the smallest degree of variation of the pixel value is selected, and the mean value of the pixel value in the region corresponding to this mask is output. In this case, the noise can be suppressed while the edge is preserved. However, it has been pointed out that the fine texture is lost, which is a disadvantage.

[0010] The above conventional technologies utilize the mean value of the pixel values in the region corresponding to a mask the target pixel centered as the output of the target pixel. One of the known method for obtaining the mean value includes selecting eight neighboring pixels x, y, z, a, c, d, e, f around a target pixel b, i.e. the pixel to be filtered, and calculating an absolute value of a difference between the target pixel and each of the eight neighboring pixels. When the absolute value of the difference between the target pixel and one of the eight neighboring pixels is larger than a standard deviation, the neighboring pixel is abandoned, not putted in the mean value filtering computation. When the absolute value of the difference between the target pixel and one of the eight neighboring pixels is not larger than a standard deviation, the neighboring pixel is putted in the mean value filtering computation. Hence, there are several cases such as b′=average(xyzabcdef), b′=average(xyzb) and b′=average(bcdef) etc. to obtain the mean value of the target pixel value and the pixel values in the neighborhood thereof. In performing the noise filtering computation, it is possible to use 9, 8, 7 . . . etc. as the divisor. For example, when b′=average(xyzabcdef) is used to obtain the mean value of the pixel values, the divisor of each of the pixel values putted in the noise filtering computation is 9. The noise filtering computation would be complicated whether implemented using hardware, software or a combination of hardware and software, and consume much time.

[0011] Accordingly, it is an intention to provide a noise filtering method for image data, which can overcome the above drawbacks, and effectively and rapidly performs the noise filtering process for image data.

SUMMARY OF THE INVENTION

[0012] It is one objective of the present invention to provide an accelerative noise filtering method for image data, which selects neighboring pixels among four neighboring pixels around a target pixel, i.e. the pixel to be filtered, in a pattern of a cross shape or X shape according to the degree of similarity between the target pixel and the neighboring pixels. The selected neighboring pixels are putted in a noise filtering computation to obtain a new pixel value for replacing the target pixel. The noise filtering process of image data is thus simplified and accelerated.

[0013] It is another objective of the present invention to provide an accelerative noise filtering method for image data, which employs the binary index concept to determine the weightings of four neighboring pixels around the target pixel in a pattern of a cross shape or X shape so as to simply the noise filtering computation.

[0014] It is a further objective of the present invention to provide an accelerative noise filtering method for image data, which can be used for preprocessing an original image data.

[0015] In order to achieve the above objectives of this invention, the present invention provides an accelerative noise filtering method for image data. Image data are provided and a pixel to be filtered as a target pixel is selected from the image data. Then, selecting four neighboring pixels around the target pixel in a pattern of a cross shape or X shape from the image data. Calculating an absolute value of a difference between the target pixel and each of the four neighboring pixels. Comparing the absolute value of each difference with a standard deviation, when the absolute value of the difference is not larger than the standard deviation, setting a binary value of a bit corresponding to the neighboring pixel as “1”, and while when the absolute value of the difference is larger than the standard deviation, setting a binary value of a bit corresponding to the neighboring pixel as “0”, thereby establishing a 4-bit mapping table comprising the binary values of the four neighboring pixels. Calculating a new pixel value for replacing the target pixel value based on a calculation (I) derived from the 4-bit mapping table: $\begin{matrix} {X_{0}^{\prime} = \frac{\sum\limits_{i = 0}^{4}{K\quad i\quad X\quad i}}{\sum\limits_{i = 0}^{4}{K\quad i}}} & (I) \end{matrix}$

[0016] wherein X₀ represents the target pixel value and X₀′ represents the new pixel value, X₁ (i=1˜4) represents the pixel value of one of the four neighboring pixels, X₁ belonging to a scan line preceding the scan line the target pixel value X₀ belonging to, X₂ and X₃ belonging to the same scan line with the target pixel value X₀, X₂ is the neighboring pixel value preceding the target pixel value X₀ and X₃ is the neighboring pixel value following the target pixel value X₀, and X₄ belonging to a scan line following the scan line the target pixel value X₀ belonging to, K_(i) (i=0˜4) is a weighting coefficient of one of the four neighboring pixels and the target pixel, when the binary value of the neighboring pixel is set as “0”, the weighting coefficient K_(i) thereof is set zero, and the neighboring pixels having the binary value “1” are provided with equivalent weighting coefficients. The present method for noise reduction substitutes a target pixel with a weighted average of the target pixel itself and four neighboring pixels around it in a pattern of a cross shape or X shape according to the degree of similarity between the target pixel and the neighboring pixels. The noise filtering computation of the present method is thus significantly simplified and the computation is accelerated.

BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The objectives and features of the present invention as well as advantages thereof will become apparent from the following detailed description, considered in conjunction with the accompanying drawings.

[0018]FIGS. 1A and 1B are a flow diagram of a noise filtering process according to one preferred embodiment of the present invention;

[0019]FIG. 2A is a diagram illustrating an example of selection of a mask of the preferred embodiment of FIGS. 1A and 1B;

[0020]FIG. 2B is a diagram illustrating an example of selection of a mask of another preferred embodiment of the present invention;

[0021]FIG. 3 is a mapping table (I) illustrating possible cases applied in the present noise filtering method; and

[0022]FIG. 4 is a mapping table (II) illustrating possible weightings of neighboring pixels around a target pixel utilized in a noise filtering computation of the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENT

[0023] The present invention provides an accelerative noise filtering method, which selects neighboring pixels of a target pixel, i.e. the pixel to be filtered, among four neighboring pixels around the target pixel in a pattern of a cross shape or X shape according to the degree of similarity between the target pixel and the neighboring pixels. Then, the selected neighboring pixels are putted into a noise filtering computation to obtain a new pixel value for replacing the target pixel value. The new pixel value is a weighted average of the pixel values of the target pixel and the selected neighboring pixels. By the present invention, the noise filtering computation is simplified to only use the module of shift and adder in hardware. Thus, the noise filtering process for image data is more simple and easier than the conventional filtering technologies. The computation time is significantly reduced.

[0024] The present invention will be described in detail in accordance with the following preferred embodiments and with reference to the accompanying drawings.

[0025]FIGS. 1A and 1B depict a flow diagram illustrating a noise filtering method according to one preferred embodiment of the present invention. The noise filtering method of the preferred embodiment begins at step 101. At step 102, image data are provided and a target pixel P₀, i.e. a pixel to be filtered, is selected from the image data. Next, at step 103, referring to FIG. 2A, four neighboring pixels P₁, P₂, P₃, P₄ around the target pixel P₀ in a pattern of a cross shape is selected. The neighboring pixel P₁ belongs to a scan line preceding the scan line the target pixel P₀ belongs to. The neighboring pixels P₂ and P₃ belong to the same scan line with the target pixel P₀. The neighboring pixel P₂ precedes the target pixel P₀ and the neighboring pixel P₃ follows the target pixel P₀. The neighboring pixel P₄ belongs to a scan line follows the scan line the target pixel P₀ belongs to.

[0026] Then, at step 104, calculating an absolute value of a difference between the target pixel P₀ and each of the four neighboring pixels P₁, P₂, P₃ and P₄. Next, at step 105, Comparing the absolute value of the difference between the target pixel P₀ and any of the neighboring pixels P₁, P₂, P₃ and P₄ with a standard deviation. When the absolute value of the difference is not larger than a standard deviation, go to step 106, setting a binary value of a bit corresponding to the neighboring pixel as “1”. When the absolute value of the difference is larger than a standard deviation, go to step 107, setting a binary value of a bit corresponding to the neighboring pixel as “0”. At step 108, establishing a 4-bit mapping table including the binary values of the neighboring pixels P₁, P₂, P₃ and P₄ in accordance with the result generated from step 105 through 107. Referring to table (I) shown in FIG. 3, the 4-bit mapping table established by step 105 through 107 is matched with one case shown in the table (I). That is, the 4-bit condition of the four neighboring pixels P₁, P₂, P₃ and P₄ can map to any one of the sixteen cases, case 0 through 15, shown in table (I).

[0027] Next, at step 109, a calculation (I) shown in the following is derived from the 4-bit mapping table: $\begin{matrix} {X_{0}^{\prime} = \frac{\sum\limits_{i = 0}^{4}{K\quad i\quad X\quad i}}{\sum\limits_{i = 0}^{4}{K\quad i}}} & (I) \end{matrix}$

[0028] wherein X₀ represents the target pixel value and X₀′ represents a new pixel value for replacing the target pixel value X₀, X₁ (i=1˜4) represents one pixel value of one neighboring pixel P_(i) (i=1˜4) among the four neighboring pixels P₁, P₂, P₃ and P₄. K_(i) (i=0˜4) is a weighting coefficient of one of the four neighboring pixels and the target pixel. When the binary value of the neighboring pixel P₁ is set as “0”, the weighting coefficient K_(i) thereof is set zero, and the neighboring pixels among the four neighboring pixels having the binary value “1” are provided with equivalent weighting coefficients. Referring to table (II) shown in FIG. 4, showing the weighting coefficients of the target pixel P₀ and the four neighboring pixels P₁, P₂, P₃ and P₄, respectively mapping each case of table (I). As shown in table (II), when the binary value of each of the neighboring pixels is set “0”, the weighting coefficient of the target pixel is the value of 1, see case 0. When the binary value of one of the neighboring pixels is set “1” and the remains are set “0”, the weighting coefficient of both of the target pixel and the neighboring pixel is the value of ½, see cases 1, 2, 4, and 8. When the binary value of two of the neighboring pixels is set “1” and the remains are set “0”, the weighting coefficient of both of the two neighboring pixels is the value of ¼ and the weighting coefficient of the target pixel is the value of ½, see cases 3, 5, 6, 9, 10, 12 and 13. When the binary value of one of the neighboring pixels is set “0” and the remaining three having the binary value “1”, selecting the two neighboring pixels among the remaining three into the calculation (I), and the weighting coefficient of both of the two neighboring pixels is the value of ¼ and the weighting coefficient of said target pixel is the value of ½, see cases 7, 11 and 14. Referring to tables (I) and (II), it is preferable to select the two neighboring pixels among the three neighboring pixels having binary value “1” belonging to the same scan line with the target pixel to put in calculation (I). For example, see case 7, the two neighboring pixels P₂ and P₃ among the three neighboring pixels P₂, P₃ and P₄ are selected, and the weighting coefficient of the two neighboring pixels P₂ and P₃ is the value of ¼. The target pixel has a weighting coefficient of ½ in the case 7. In case that the image data are captured by a scanner, the pixels easily become blurred aligning the direction of the movement of a stepping motor used for moving a scanning head. Therefore, for case 11 with the three neighboring pixels P₁, P₃ and P₄ having binary value “1”, it is preferable to select the two neighboring pixels P₃ and P₄ to put in calculation (I), and the weighting coefficient of each of the two neighboring pixels P₃ and P₄ is the value of ¼. The target pixel has a weighting coefficient of ½ in the case 11. Furthermore, in case 14 with the three neighboring pixels P₁, P₂ and P₄ having binary value “1”, it is preferable to select the two neighboring pixels P₁ and P₂ to put in calculation (I), and the weighting coefficient of each of the two neighboring pixels P₁ and P₂ is the value of ¼. The target pixel has a weighting coefficient of ½ in the case 14. When the binary value of each of the four neighboring pixels is set “1”, the weighting coefficient of each neighboring pixel is the value of ⅛ and the weighting coefficient of the target pixel is the value of ½, see case 15.

[0029] Then, at step 110, calculating a new pixel value X₀ based on the calculation (I) derived from the 4-bit mapping table. The weighting coefficients of the target pixel and the four neighboring pixels are obtained from the 4-bit mapping table. The new pixel Value X₀′ is replaced for the target pixel value X₀. At step 111, determining if the noise filtering computation is going to be performed for a next pixel? If it is yes, go to step 112, shifting to the next pixel, and repeating step 102 through 111. If it is not, go to step 113, completing the noise filtering computation.

[0030] In accordance with the foregoing, the present invention can only use the module of shift and adder in hardware to perform the noise filtering process. The complexity of the hardware used therefor is significantly reduced, and the computation time of the present method whether implemented by hardware, software or in a combination of hardware and software is much shorter.

[0031] Referring to FIG. 2B, in another preferred embodiment, the four neighboring pixels P₁, P₂, P₃ and P₄ around the target pixel P₀ in an X-shaped pattern are selected. The noise filtering process is the same with that depicted in FIGS. 1A and 1B. That is, step 101 through 113 is repeated in this preferred embodiment.

[0032] The preferred embodiments are only used to illustrate the present invention, it is not intended to limit the scope thereof. Many modifications of the embodiments can be made without departing from the spirit of the present invention. 

What is claimed is:
 1. An accelerative noise filtering method for image data, comprising: providing image data; selecting a pixel to be filtered as a target pixel from said image data; selecting four neighboring pixels around said target pixel in a pattern of a cross shape from said image data; calculating an absolute value of a difference between said target pixel and each said neighboring pixel; comparing the absolute value of each said difference with a standard deviation, when the absolute value of said difference is not larger than said standard deviation, setting a binary value of a bit corresponding to said neighboring pixel as “1”, and while when the absolute value of said difference is larger than said standard deviation, setting a binary value of a bit corresponding to said neighboring pixel as “0”, thereby establishing a 4-bit mapping table comprising the binary values of said four neighboring pixels; and calculating a new pixel value for replacing the target pixel value based on a calculation (I) derived from said 4-bit mapping table: $\begin{matrix} {X_{0}^{\prime} = \frac{\sum\limits_{i = 0}^{4}{K\quad i\quad X\quad i}}{\sum\limits_{i = 0}^{4}{K\quad i}}} & (I) \end{matrix}$

 wherein X₀ represents said target pixel value and X₀′ represents said new pixel value, X_(i) (i=1˜4) represents one pixel value of one said neighboring pixel, X_(i) belonging to a scan line preceding the scan line said target pixel value X₀ belonging to, X₂ and X₃ belonging to the same scan line with said target pixel value X₀, X₂ is the neighboring pixel value preceding said target pixel value X₀ and X₃ is the neighboring pixel value following said target pixel value X₀, and X₄ belonging to a scan line following the scan line said target pixel value X₀ belonging to, K_(i) (i=0˜4) is a weighting coefficient of one of said neighboring pixels and said target pixel, when the binary value of said neighboring pixel is set as “0”, said weighting coefficient K_(i) thereof is set zero, and said neighboring pixels having the binary value “1” are provided with equivalent weighting coefficients.
 2. The method of claim 1, wherein when the binary value of each said neighboring pixel is set “0”, the weighting coefficient of said target pixel is the value of
 1. 3. The method of claim 1, wherein when the binary value of one of said neighboring pixels is set “1” and the remains are set “0”, the weighting coefficient of both of said target pixel and said neighboring pixel is the value of ½.
 4. The method of claim 1, wherein when the binary value of two of said neighboring pixels is set “1” and the remains are set “0”, the weighting coefficient of both of said two neighboring pixels is the value of ¼ and the weighting coefficient of said target pixel is the value of ½.
 5. The method of claim 1, wherein when the binary value of one of said neighboring pixels is set “0” and the remaining three having the binary value “1”, selecting the two neighboring pixels among the remaining three into said calculation (I), and the weighting coefficient of both of said two neighboring pixels is the value of ¼ and the weighting coefficient of said target pixel is the value of ½.
 6. The method of claim 5, wherein said two neighboring pixels belong to the same scan line with said target pixel.
 7. The method of claim 1, wherein when the binary value of each said neighboring pixel is set “1”, the weighting coefficient of each said neighboring pixel is the value of ⅛ and the weighting coefficient of said target pixel is the value of ½.
 8. The method of claim 1, wherein said image data are captured by a scanner.
 9. The method of claim 8, wherein when the binary value of one of said neighboring pixels is set “0” and the remaining three having the binary value “1”, selecting the two neighboring pixels among the remaining three not aligning the direction of the movement of a stepping motor of said scanner into said calculation (I), and the weighting coefficient of both of said two neighboring pixels is the value of ¼ and the weighting coefficient of said target pixel is the value of ½.
 10. An accelerative noise filtering method for image data, comprising: providing image data; selecting a pixel to be filtered as a target pixel from said image data; selecting four neighboring pixels around said target pixel in a X-shaped pattern from said image data; calculating an absolute value of a difference between said target pixel and each said neighboring pixel; comparing the absolute value of each said difference with a standard deviation, when the absolute value of said difference is not larger than said standard deviation, setting a binary value of a bit corresponding to said neighboring pixel as “1”, and while when the absolute value of said difference is larger than said standard deviation, setting a binary value of a bit corresponding to said neighboring pixel as “0”, thereby establishing a 4-bit mapping table comprising the binary values of said four neighboring pixels; and calculating a new pixel value for replacing the target pixel value based on a calculation (I) derived from said 4-bit mapping table: $\begin{matrix} {X_{0}^{\prime} = \frac{\sum\limits_{i = 0}^{4}{K\quad i\quad X\quad i}}{\sum\limits_{i = 0}^{4}{K\quad i}}} & (I) \end{matrix}$

 wherein X₀ represents said target pixel value and X₀′ represents said new pixel value, X_(i) (i=1˜4) represents one pixel value of one said neighboring pixel, X_(i) belonging to a scan line preceding the scan line said target pixel value X₀ belonging to, X₂ and X₃ belonging to the same scan line with said target pixel value X₀, X₂ is the neighboring pixel value preceding said target pixel value X₀ and X₃ is the neighboring pixel value following said target pixel value X₀, and X₄ belonging to a scan line following the scan line said target pixel value X₀ belonging to, K_(i) (i=0˜4) is a weighting coefficient of one of said neighboring pixels and said target pixel, when the binary value of said neighboring pixel is set as “0”, said weighting coefficient K_(i) thereof is set zero, and said neighboring pixels having the binary value “1” are provided with equivalent weighting coefficients.
 11. The method of claim 10, wherein when the binary value of each said neighboring pixel is set “0”, the weighting coefficient of said target pixel is the value of
 1. 12. The method of claim 10, wherein when the binary value of one of said neighboring pixels is set “1” and the remains are set “0”, the weighting coefficient of both of said target pixel and said neighboring pixel is the value of ½.
 13. The method of claim 10, wherein when the binary value of two of said neighboring pixels is set “1” and the remains are set “0”, the weighting coefficient of both of said two neighboring pixels is the value of ¼ and the weighting coefficient of said target pixel is the value of ½.
 14. The method of claim 10, wherein when the binary value of one of said neighboring pixels is set “0” and the remaining three having the binary value “1”, selecting the two neighboring pixels among the remaining three into said calculation (I), and the weighting coefficient of both of said two neighboring pixels is the value of ¼ and the weighting coefficient of said target pixel is the value of ½.
 15. The method of claim 14, wherein said two neighboring pixels belong to the same scan line with said target pixel.
 16. The method of claim 10, wherein when the binary value of each said neighboring pixel is set “1”, the weighting coefficient of each said neighboring pixel is the value of ⅛ and the weighting coefficient of said target pixel is the value of ½.
 17. The method of claim 10, wherein said image data are captured by a scanner.
 18. The method of claim 17, wherein when the binary value of one of said neighboring pixels is set “0” and the remaining three having the binary value “1”, selecting the two neighboring pixels among the remaining three not aligning the direction of the movement of a stepping motor of said scanner into said calculation (I), and the weighting coefficient of both of said two neighboring pixels is the value of ¼ and the weighting coefficient of said target pixel is the value of ½. 